import request from '@/utils/request'

// 获取部门列表
export function getDepartmentAPI() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 获取部门负责人列表
export function getManagerListAPI() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

// 新增部门

export function addDeparmentAPI(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取详情,用于回填
export function updateDeparmentAPI(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 更新详情
export function changeDeparmentAPI(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门接口
export function deleteDeparmentAPI(data) {
  return request({
    url: `/company/department/${data}`,
    method: 'delete'

  })
}

